//出差列表
function findTrips(CertusFormAjax) {
    //查询审批人信息
    CertusFormAjax.ajax("findSpinfos", {
        "code": "%NCCLC%"
    }, function (response) {
        var data = response.data;
        var oabtColumns = [{
            id: 'userName',
            title: '审批人',
            type: 'string',
            width: 75,
            columnClass: 'text-center',
        }
        // , {
        //     id: 'departmentCode',
        //     title: '所属部门',
        //     type: 'string',
        //     columnClass: 'text-center',
        // }
        , {
            id: 'company',
            title: '所属公司',
            type: 'string',
            columnClass: 'text-center',
            resolution: function (value, record, column, grid, dataNo, columnNo) {
                var content = '';
                if (record.company == "HFKJ") {
                    content += '浩方科技';
                } else if (record.company == "HFXX") {
                    content += '浩方信息';
                } else if (record.company == "STSBJ") {
                    content += '赛特斯北京';
                } else if (record.company == "STSGD") {
                    content += '赛特斯广东';
                } else if (record.company == "STSJT") {
                    content += '赛特斯集团';
                } else if (record.company == "STSNJ") {
                    content += '赛特斯南京';
                } else if (record.company == "STSSH") {
                    content += '赛特斯上海';
                } else if (record.company == "SYB-RX") {
                    content += '融合运维事业部';
                }
                return content;
            }
        }, {
            id: 'comments',
            title: '职位',
            type: 'string',
            columnClass: 'text-center',
        }, {
            id: 'approveLevel',
            title: '审批级别',
            type: 'string',
            width: 75,
            columnClass: 'text-center',
        }, {
            id: 'minValue',
            title: '天数',
            type: 'string',
            width: 50,
            columnClass: 'text-center',
        }];
        var oabtOption = {
            lang: 'zh-cn',
            ajaxLoad: false,
            // loadURL:'url',
            exportFileName: '出差计划列表',
            datas: data,
            columns: oabtColumns,
            gridContainer: 'spContainer',
            toolbarContainer: 'spToolContainer',
            tools: '',
            pageSize: 10,
            pageSizeLimit: [10, 15, 20]
        };
        oabtGrid = $.fn.dlshouwen.grid.init(oabtOption);
        oabtGrid.load();
    });


    CertusFormAjax.ajax("findLists", {}, function (response) {
        var data = response.data;
        var oabtColumns = [{
            id: 'trip_num',
            title: '出差/公干单号',
            type: 'string',
            columnClass: 'text-center',
        }, {
            id: 'actualTripTime',
            title: '开始时间',
            type: 'string',
            width: 100,
            columnClass: 'text-center'
        }, {
            id: 'actualEndTime',
            title: '结束时间',
            type: 'string',
            width: 100,
            columnClass: 'text-center',
        }, {
            id: 'buget',
            title: '预测费用',
            type: 'string',
            width: 150,
            columnClass: 'text-center',
            resolution: function (value, record, column, grid, dataNo, columnNo) {
                var content = '￥' + value + '元';
                return content;
              }
        }, {
            id: 'user_name',
            title: '申请人',
            type: 'string',
            width: 75,
            columnClass: 'text-center',
        }, {
            id: 'create_time',
            title: '申请时间',
            type: 'date',
            width: 100,
            format: 'yyyy-MM-dd',
            otype: 'time_stamp_ms',
            columnClass: 'text-center',
        }, {
            id: 'type',
            title: '类型',
            type: 'string',
            width: 50,
            columnClass: 'text-center',
        }, {
            id: 'node_flag',
            title: '状态',
            type: 'string',
            width: 120,
            columnClass: 'text-center',
            resolution: function (value) {
                var content = '';
                if (value == "1") {
                    content = "申请待审批";
                } else if (value=="2"){
                    content = "申请不通过";
                }else if (value == "3") {
                    content = "申请被退回";
                } else if (value == "5") {
                    content = "申请取消";
                } else if (value == "8") {
                    content = "已提交出差结果";
                } else if (value == "11") {
                    content = "申请待审批";
                } else {
                    content = "申请待审批";
                }
                return content;
            }
        }, {
            id: 'operation',
            title: '操作',
            type: 'string',
            width: 60,
            columnClass: 'text-center',
            resolution: function (value, record) {
                var content = '';
                content += '<a class="btn btn-xs btn-primary" href="javascript:tripdetail(\'' + record.process_instance_id + '\')"><i class="icon-eye-open"></i>  查看</a>';
                return content;
            }
        }];
        var oabtOption = {
            lang: 'zh-cn',
            ajaxLoad: false,
            // loadURL:'url',
            exportFileName: '出差计划列表',
            datas: data,
            columns: oabtColumns,
            gridContainer: 'oabtContainer',
            toolbarContainer: 'oabtToolBarContainer',
            tools: '',
            pageSize: 10,
            pageSizeLimit: [10, 15, 20]
        };
        oabtGrid = $.fn.dlshouwen.grid.init(oabtOption);
        oabtGrid.load();
    });

    this.tripdetail = function (processId) {
        location.href = "#/selTrip/" + processId;
    }
}
//个人出差申请start----
function addTrips(CertusFormAjax, $scope) {
    var plansList = [];
    this.shoabtmeg = function () {
        if (plansList.length > 0) {
            $("#type").attr("disabled", true);
        }
        $(".hdoabtmeg").show();
    };
    this.hdoabtmeg = function () {
        $("#isShow").hide();
    };

    CertusFormAjax.ajax("findSeProList", {}, function (response) {
        var nhlTeams = [];
        var data = response.data;
        for (var i = 0; i < data.length; i++) {
            var arr = {};
            arr.name = data[i].proName;
            arr.id = data[i].id;
            nhlTeams.push(arr);
        }
        //自动补全
        var nhl = $.map(nhlTeams, function (obj) {
            return {
                value: obj.name,
                data: {
                    category: obj.id
                }
            };
        });
        // Initialize autocomplete with local lookup:
        $('#proName').devbridgeAutocomplete({
            lookup: nhl,
            minChars: 1,
            onSelect: function (suggestion) {
                $("#proId").val(suggestion.data.category);
            },
            showNoSuggestionNotice: true,
            noSuggestionNotice: 'Sorry, no matching results'
        });

    });

    CertusFormAjax.ajax('initDepts', {}, function (response) {
        var data = response.data;
        $scope.depts = data;
        if (data.length == 1) {
            $("#deptCode").attr("disabled", "disabled");
        }
        $scope.deptCode = data[0].departmentCode;
    });

    this.changeType = function (value) {
        if (value == 1) {
            $("#isTrip").css("display", "");
            $("#ist1").css("display", "");
            $("#ist2").css("display", "");
            $("#ist3").css("display", "");
        } else {
            $("#isTrip").css("display", "none");
            $("#ist1").css("display", "none");
            $("#ist2").css("display", "none");
            $("#ist3").css("display", "none");
        }
    };

    CertusFormAjax.ajax("findSpUserList", {}, function (response) {
        $('#selectPage').bSelectPage({
            showField: 'userName',
            keyField: 'userId',
            data: response.data,
            multiple: true
        });
    });

    var did = 0;
    var oabtGrid;

    // 出差计划
    var oabtColumns = [{
        id: 'proName',
        title: '归属项目',
        width: 150,
        type: 'string',
        columnClass: 'text-center',
    }, {
        id: 'planStarTime',
        title: '计划开始时间',
        width: 100,
        type: 'string',
        columnClass: 'text-center',
    }, {
        id: 'planEndTime',
        title: '计划结束时间',
        width: 100,
        type: 'string',
        columnClass: 'text-center',
    }, {
        id: 'planCity',
        title: '地点',
        width: 100,
        type: 'string',
        columnClass: 'text-center',
    }, {
        id: 'planComments',
        title: '工作计划',
        type: 'string',
        columnClass: 'text-left',
    }, {
        id: 'operation',
        title: '操作',
        width: 60,
        type: 'string',
        columnClass: 'text-center',
        resolution: function (value, record, column, grid, dataNo, columnNo) {
            var content = '';
            content += '<button class="btn btn-xs btn-danger" onclick="delPlans(' + record.did + ',' + record.proId + ');"><i class="fa fa-trash-o"></i>  删除</button>';
            return content;
        }
    }];
    var oabtOption = {
        lang: 'zh-cn',
        ajaxLoad: false,
        extraWidth: 20,
        // loadURL:'url',
        exportFileName: '出差计划',
        datas: plansList,
        columns: oabtColumns,
        gridContainer: 'oabtContainer1',
        tools: ''
    };
    oabtGrid = $.fn.dlshouwen.grid.init(oabtOption);
    oabtGrid.load();

    var proIdArr = [];
    var code = "";
    $(".addTripPlan").on('click', function () {
        var proId = $("#proId").val();
        for (var i = 0; i < proIdArr.length; i++) {
            if (proId == proIdArr[i]) {
                layer.msg("重复添加项目");
                return;
            }
        }

        if ($("#deptCode").val()==""){
            layer.msg("归属部门不能为空");
            return;
        }

        if (proId == "") {
            layer.msg("归属项目不能为空");
            return;
        }

        if (!certusValidateNotnull()) {
            return;
        }
        var data = new Date();
        var datetime = $("#plansTime").val();
        var startTime = new Date(datetime.replace("/", "-").replace("/", "-"));
        // if (datetime==""){
        //     layer.msg("计划开始日期不能为空",{time:1000});
        //     return;
        // }
        var endTime = $("#planeTime").val();
        // if (endTime==""){
        //     layer.msg("计划结束日期不能为空",{time:1000});
        //     return;
        // }
        var endTimes = new Date(endTime.replace("/", "-").replace("/", "-"));
        if (startTime > endTimes) {
            layer.msg("开始日期不能大于结束日期", {
                time: 1000
            });
            return;
        }

        var planComments = $("#planComments").val();
        // if (planComments==""){
        //     layer.msg("工作计划不能为空",{time:1000});
        //     return;
        // }
        if (planComments.length > 120) {
            layer.msg("工作计划不能大于120字", {
                time: 1000
            });
            return;
        }
        var planArr = {};
        planArr.proName = $("#proName").val();
        planArr.proId = proId;
        planArr.planCity = $("#planCity").val();
        planArr.planStarTime = $("#plansTime").val();
        planArr.planEndTime = $("#planeTime").val();
        planArr.planComments = planComments;
        planArr.did = did;
        planArr.carBuget = $("#carBuget").val();
        planArr.planeBuget = $("#planeBuget").val();
        planArr.trafficBuget = $("#trafficBuget").val();
        planArr.stayBuget = $("#stayBuget").val();
        planArr.serveBuget = $("#serveBuget").val();
        planArr.otherBuget = $("#otherBuget").val();
        planArr.subsidyBuget = $("#subsidyBuget").val();
        planArr.users = $("#selectPage").val();
        planArr.type = $("#type").val();

        CertusFormAjax.ajax('getTripVild', {
            "proId": proId
        }, function (response) {
            if (response.data) {
                layer.confirm('申请人和项目归属公司不一致，后续申请人无法报销，' +
                    '只能通过项目归属公司人员提交报销，' +
                    '请事先确认后续报销问题，避免无法报销。', {
                        title: '提示信息',
                        btn: ['提交', '取消'] //按钮
                    },
                    function (index) {
                        plansList.push(planArr);
                        did++;
                        $(".hdoabtmeg").hide();
                        clearInput();
                        $("#oabtContainer1").empty();
                        oabtGrid.load();
                        proIdArr.push(proId);
                        //关闭
                        layer.close(index);
                    });
            } else {
                plansList.push(planArr);
                did++;
                $(".hdoabtmeg").hide();
                clearInput();
                $("#oabtContainer1").empty();
                oabtGrid.load();
                proIdArr.push(proId);
            }
        });
        $("#proName").attr('disabled', false);
        $(".auto-reset").remove();
    });

    function clearInput() {
        $("#proName").val("");
        $("#proId").val("");
        $("#selectPage").val("");
        $("#planCity").val("");
        $("#plansTime").val("");
        $("#planeTime").val("");
        $("#planComments").val("");
        $("#carBuget").val("");
        $("#planeBuget").val("");
        $("#trafficBuget").val("");
        $("#stayBuget").val("");
        $("#serveBuget").val("");
        $("#otherBuget").val("");
        $("#subsidyBuget").val("");
        $(".selected_tag").remove();
        $("#selectPage").val("");
    }

    //删除工作计划、删除项目
    this.delPlans = function (id, proId) {
        layer.confirm('确认删除此数据？', {
            btn: ['确认', '取消'] //按钮
        }, function () {
            var dArr = {};
            for (var i = 0; i < plansList.length; i++) {
                if (plansList[i].did == id) {
                    dArr = plansList[i];
                }
            }
            for (var i = 0; i < proIdArr.length; i++) {
                if (proIdArr[i] == proId) {
                    proIdArr.splice($.inArray(proId, proIdArr), 1);
                }
            }
            plansList.splice($.inArray(dArr, plansList), 1);
            oabtGrid.load();
            $("#isShow").hide();
            if (plansList.length == 0) {
                $("#type").attr("disabled", false);
            }
            layer.msg('删除成功');
        });
    };
    $(".submit").on('click', function () {
        var data = {};
        if (plansList.length <= 0) {
            layer.msg("至少需要提交一条出差计划!");
            return;
        }
        // 开启
        var index = layer.load(1);
        data.plansList = plansList;
        data.deptCode = $("#deptCode").val();
        data.type = $("#type").val();
        CertusFormAjax.ajax("addTrip", {
            "param": JSON.stringify(data)
        }, function () {
            //关闭
            layer.close(index);
            layer.msg("申请成功！");
            window.history.back();
        });
    });
}

//个人出差申请end----
//显示出差计划表单
// function shoabtmeg() {
//     $('.hdoabtmeg').show();
// }
// // 隐藏出差计划表单
// function hdoabtmeg() {
//     $('.hdoabtmeg').hide();
// }

//项目其他费用表单显示隐藏
function hideother() {
    $(".hideother").hide();
};

function showother() {
    $(".hideother").show();
};


// 出差申请审批页面-出差计划列表
var oabt1Columns = [{
    id: 'gpro',
    title: '归属项目',
    width: 150,
    type: 'string',
    columnClass: 'text-center',
}, {
    id: 'ftime',
    title: '计划开始时间',
    width: 100,
    type: 'string',
    columnClass: 'text-center',
}, {
    id: 'etime',
    title: '计划结束时间',
    width: 100,
    type: 'string',
    columnClass: 'text-center',
}, {
    id: 'address',
    title: '地点',
    width: 100,
    type: 'string',
    columnClass: 'text-center',
}, {
    id: 'oplan',
    title: '工作计划',
    type: 'string',
    columnClass: 'text-left',
},];
var oabt1Option = {
    lang: 'zh-cn',
    ajaxLoad: false,
    extraWidth: 20,
    // loadURL:'url',
    exportFileName: '出差计划',
    datas: [{
        id: 1,
        gpro: '移动物联网A项目',
        ftime: '2018/01/02 08:00',
        etime: '2018/02/01 12:00',
        address: '南京',
        oplan: '工作计划测试数据',
    }, {
        id: 2,
        gpro: '联通公司云产品B项目',
        ftime: '2018/01/02 08:00',
        etime: '2018/02/01 12:00',
        address: '北京',
        oplan: '工作计划测试数据',
    },],
    columns: oabt1Columns,
    gridContainer: 'oabt1Container',
    toolbarContainer: 'oabt1ToolBarContainer',
    tools: '',
    pageSize: 10,
    pageSizeLimit: [10, 15, 20]
};
var oabt1Grid = $.fn.dlshouwen.grid.init(oabt1Option);
$(function () {
    oabt1Grid.load();
});

// 出差结果填写页面-出差计划与结果列表
var oabt2Columns = [{
    id: 'gpro',
    title: '归属项目',
    width: 150,
    type: 'string',
    columnClass: 'text-center',
}, {
    id: 'ftime',
    title: '计划开始时间',
    width: 100,
    type: 'string',
    columnClass: 'text-center',
}, {
    id: 'etime',
    title: '计划结束时间',
    width: 100,
    type: 'string',
    columnClass: 'text-center',
}, {
    id: 'address',
    title: '地点',
    width: 100,
    type: 'string',
    columnClass: 'text-center',
}, {
    id: 'oplan',
    title: '工作计划',
    type: 'string',
    columnClass: 'text-left',
}, {
    id: 'ftime1',
    title: '实际开始时间',
    width: 100,
    type: 'string',
    columnClass: 'text-center',
}, {
    id: 'etime1',
    title: '实际结束时间',
    width: 100,
    type: 'string',
    columnClass: 'text-center',
}, {
    id: 'oend',
    title: '工作结果',
    type: 'string',
    columnClass: 'text-left',
}, {
    id: 'operation',
    title: '操作',
    width: 80,
    type: 'string',
    columnClass: 'text-center',
    resolution: function (value, record, column, grid, dataNo, columnNo) {
        var content = '';
        content += '<button class="btn btn-xs btn-info" onclick="shoabtmeg();"><i class="fa fa-edit"></i>  编辑</button>';
        return content;
    }
}];
var oabt2Option = {
    lang: 'zh-cn',
    ajaxLoad: false,
    extraWidth: 20,
    // loadURL:'url',
    exportFileName: '出差计划',
    datas: [{
        id: 1,
        gpro: '移动物联网A项目',
        ftime: '2018/01/02 08:00',
        etime: '2018/02/01 12:00',
        ftime1: '',
        etime1: '',
        address: '南京',
        oplan: '工作计划测试数据',
        oend: '',
    }, {
        id: 2,
        gpro: '联通公司云产品B项目',
        ftime: '2018/01/02 08:00',
        etime: '2018/02/01 12:00',
        ftime1: '',
        etime1: '',
        address: '北京',
        oplan: '工作计划测试数据',
        oend: '',
    },],
    columns: oabt2Columns,
    gridContainer: 'oabt2Container',
    toolbarContainer: 'oabt2ToolBarContainer',
    tools: '',
    pageSize: 10,
    pageSizeLimit: [10, 15, 20]
};
var oabt2Grid = $.fn.dlshouwen.grid.init(oabt2Option);
$(function () {
    oabt2Grid.load();
});

// 出差结果审批页面-出差计划与结果列表
var oabt3Columns = [{
    id: 'gpro',
    title: '归属项目',
    width: 150,
    type: 'string',
    columnClass: 'text-center',
}, {
    id: 'ftime',
    title: '计划开始时间',
    width: 100,
    type: 'string',
    columnClass: 'text-center',
}, {
    id: 'etime',
    title: '计划结束时间',
    width: 100,
    type: 'string',
    columnClass: 'text-center',
}, {
    id: 'address',
    title: '地点',
    width: 100,
    type: 'string',
    columnClass: 'text-center',
}, {
    id: 'oplan',
    title: '工作计划',
    type: 'string',
    columnClass: 'text-left',
}, {
    id: 'ftime1',
    title: '实际开始时间',
    width: 100,
    type: 'string',
    columnClass: 'text-center',
}, {
    id: 'etime1',
    title: '实际结束时间',
    width: 100,
    type: 'string',
    columnClass: 'text-center',
}, {
    id: 'oend',
    title: '工作结果',
    type: 'string',
    columnClass: 'text-left',
},];
var oabt3Option = {
    lang: 'zh-cn',
    ajaxLoad: false,
    extraWidth: 20,
    // loadURL:'url',
    exportFileName: '出差计划',
    datas: [{
        id: 1,
        gpro: '移动物联网A项目',
        ftime: '2018/01/02 08:00',
        etime: '2018/02/01 12:00',
        address: '南京',
        oplan: '工作计划测试数据',
        ftime1: '2018/01/02 08:00',
        etime1: '2018/02/01 12:00',
        oend: '已完成计划内容，具体完成情况测试数据',
    }, {
        id: 2,
        gpro: '联通公司云产品B项目',
        ftime: '2018/01/02 08:00',
        etime: '2018/02/01 12:00',
        address: '北京',
        oplan: '工作计划测试数据',
        ftime1: '2018/01/02 08:00',
        etime1: '2018/02/01 12:00',
        oend: '已完成计划内容，具体完成情况测试数据',
    },],
    columns: oabt3Columns,
    gridContainer: 'oabt3Container',
    toolbarContainer: 'oabt3ToolBarContainer',
    tools: '',
    pageSize: 10,
    pageSizeLimit: [10, 15, 20]
};
var oabt3Grid = $.fn.dlshouwen.grid.init(oabt3Option);
$(function () {
    oabt3Grid.load();
});


// 报销费用明细
var afrColumns = [{
    id: 'afrCl',
    title: '报销主体公司',
    width: 150,
    type: 'string',
    columnClass: 'text-center',
}, {
    id: 'afrType',
    title: '报销类目',
    width: 150,
    type: 'string',
    columnClass: 'text-center',
}, {
    id: 'afrPic',
    title: '金额',
    type: 'string',
    width: 100,
    columnClass: 'text-center',
    resolution: function (value, record, column, grid, dataNo, columnNo) {
        var content = '￥' + value + '元';
        return content;
      }
}, {
    id: 'afrTime',
    title: '开票日期',
    type: 'string',
    width: 100,
    columnClass: 'text-center',
}, {
    id: 'afrCl',
    title: '开票单位',
    type: 'string',
    width: 150,
    columnClass: 'text-center',
}, {
    id: 'afrNumber',
    title: '原始单据数量',
    type: 'string',
    width: 100,
    columnClass: 'text-center',
}, {
    id: 'afrMsg',
    title: '费用报销明细说明',
    type: 'string',
    columnClass: 'text-left',
}, {
    id: 'operation',
    title: '操作',
    width: 280,
    type: 'string',
    columnClass: 'text-center',
    resolution: function (value, record, column, grid, dataNo, columnNo) {
        var content = '';
        content += '<button class="btn btn-xs btn-success" onclick="addProTrip(\'' + record.id + '\');"><i class="icon-plus"></i>  项目占比</button>';
        content += '  ';
        content += '<button class="btn btn-xs btn-primary" data-toggle="modal" href="#myModal" onclick=""><i class="icon-eye-open"></i>  项目占比</button>';
        content += '  ';
        content += '<button class="btn btn-xs btn-info" onclick="layer.msg(\'编辑' + record.id + '信息\');"><i class="fa fa-edit"></i>  编辑</button>';
        content += '  ';
        content += '<button class="btn btn-xs btn-danger" onclick="del(' + record.id + ');"><i class="fa fa-trash-o"></i>  删除</button>';
        return content;
    }
}];
var afrOption = {
    lang: 'zh-cn',
    ajaxLoad: false,
    extraWidth: 20,
    // loadURL:'url',
    exportFileName: '报销费用明细',
    datas: [{
        id: 1,
        afrCl: '赛特斯南京分公司',
        afrType: '交通费用',
        afrPic: '￥99999.00元',
        afrTime: '2018-01-02',
        afrNumber: '1张',
        afrMsg: '费用报销明细说明测试数据',
    },],
    columns: afrColumns,
    gridContainer: 'afrContainer',
    toolbarContainer: 'afrToolBarContainer',
    tools: '',
    pageSize: 10,
    pageSizeLimit: [10, 15, 20]
};
var afrGrid = $.fn.dlshouwen.grid.init(afrOption);
$(function () {
    afrGrid.load();
});

//显示出差费用预测表单
function safrinfo() {
    $('.afrinfo').show();
}
// 隐藏出差费用预测表单
function afrinfo() {
    $('.afrinfo').hide();
}

// 添加项目占比表单
function addProTrip(id) {
    $('.haddpro').show();
};
// 隐藏项目占比表单
function haddpro() {
    $('.haddpro').hide();
}

// 修改项目占比数据
function editPro(id) {
    var af = $('#pro' + id + ' .sh-btn span').html();
    af = af.substring(0, af.length - 1);
    $('#pro' + id + ' .hd-btn input').val(af);
    $('#pro' + id + ' .sh-btn').hide();
    $('#pro' + id + ' .hd-btn').show();
};

//取消修改项目占比操作
function closePro(id) {
    var number = $('#pro' + id + ' .hd-btn input').val();
    if (number > 100 || number == 0) {
        layer.msg('填写有误，请重新填写！');
        return false;
    } else {
        var af = number + '%';
        $('#pro' + id + ' .sh-btn span').html(af);
        $('#pro' + id + ' .hd-btn').hide();
        $('#pro' + id + ' .sh-btn').show();
    }
}

//删除项目占比数据
function delPro(id) {
    layer.confirm('确认删除该项目？', {
        btn: ['确认', '取消'] //按钮
    }, function () {
        $('#pro' + id).remove();
        layer.msg('删除成功');
    });
}

// 报销申请-报销项目费用
var afr1Columns = [{
    id: 'afrPro',
    title: '归属项目',
    type: 'string',
    width: 150,
    columnClass: 'text-center',
}, {
    id: 'p1',
    title: '火车/汽车',
    width: 100,
    type: 'string',
    columnClass: 'text-center',
}, {
    id: 'p2',
    title: '飞机',
    type: 'string',
    width: 100,
    columnClass: 'text-center',
}, {
    id: 'p3',
    title: '交通费用',
    type: 'string',
    width: 100,
    columnClass: 'text-center',
}, {
    id: 'p4',
    title: '住宿费用',
    type: 'string',
    width: 100,
    columnClass: 'text-center',
    resolution: function (value, record, column, grid, dataNo, columnNo) {
        var content = '￥' + value + '元';
        return content;
      }
}, {
    id: 'p5',
    title: '招待费',
    type: 'string',
    width: 100,
    columnClass: 'text-center',
    resolution: function (value, record, column, grid, dataNo, columnNo) {
        var content = '￥' + value + '元';
        return content;
      }
}, {
    id: 'p6',
    title: '其他费用',
    type: 'string',
    width: 100,
    columnClass: 'text-center',
    resolution: function (value, record, column, grid, dataNo, columnNo) {
        var content = '￥' + value + '元';
        return content;
      }
}, {
    id: 'p7',
    title: '出差补助',
    type: 'string',
    width: 100,
    columnClass: 'text-center',
    resolution: function (value, record, column, grid, dataNo, columnNo) {
        var content = '￥' + value + '元';
        return content;
      }
}, {
    id: 'pall',
    title: '合计',
    type: 'string',
    columnClass: 'text-center',
    resolution: function (value, record, column, grid, dataNo, columnNo) {
        var content = '￥' + value + '元';
        return content;
      }
},];
var afr1Option = {
    lang: 'zh-cn',
    ajaxLoad: false,
    extraWidth: 20,
    // loadURL:'url',
    exportFileName: '报销费用明细',
    datas: [{
        id: 1,
        afrPro: '项目A测试数据',
        p1: '￥99999.00元',
        p2: '￥99999.00元',
        p3: '￥99999.00元',
        p4: '￥99999.00元',
        p5: '￥99999.00元',
        p6: '￥99999.00元',
        p7: '￥99999.00元',
        pall: '￥99999.00元',
    },],
    columns: afr1Columns,
    gridContainer: 'afr1Container',
    toolbarContainer: 'afr1ToolBarContainer',
    tools: '',
    pageSize: 10,
    pageSizeLimit: [10, 15, 20]
};
var afr1Grid = $.fn.dlshouwen.grid.init(afr1Option);
$(function () {
    afr1Grid.load();
});

// 获取焦点显示
$(".perName").focus(function () {
    $(".pdmiddle").show();
});


function pdclose() {
    $(".pdmiddle").hide();
};

// 流程图展开效果
$(function () {
    //左侧滑入组件
    // $(".second").pageslide({
    //     direction: "left",
    //     modal: true
    // });
});